package com.mbigger.synchronize;

/**
 * 可重入粒度测试，调用类内部另外的同步方法
 *
 * @author mbigg
 *
 */
public class SynchronizedRecursion10 {

    int a = 0;

    public static void main(String[] args) {
        SynchronizedRecursion10 instance = new SynchronizedRecursion10();
        instance.method1();
    }

    private synchronized void method1() {
        System.err.println("这是method1");
        method2();
    }

    private synchronized void method2() {
        System.err.println("这是method2");
    }
}
